//
//  CommonDataBase.m
//  DownDemo
//
//  Created by 喂！ on 2018/11/7.
//  Copyright © 2018年 well. All rights reserved.
//

#import "CommonDataBase.h"

@implementation CommonDataBase

+(LKDBHelper *)getUsingLKDBHelper
{
    static LKDBHelper *db;
    NSFileManager *fileMgr = [NSFileManager defaultManager];
    NSString *path = [[MainConfig sharedInstance].homeDir stringByAppendingPathComponent:@"DataBase"];
    
    
    if (![fileMgr fileExistsAtPath:path]) {
        [fileMgr createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
    }
    
    path = [path stringByAppendingString:@"info.db"];
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        db = [[LKDBHelper alloc] initWithDBPath:path];
    });
    return db;
}

@end
